﻿#ifndef PST_DIALOGHIRFEXTRAPOLATION_H
#define PST_DIALOGHIRFEXTRAPOLATION_H

#include <IdaDialogFrame>
#include <QModelIndexList>
#include <QStringListModel>
QT_BEGIN_NAMESPACE
namespace Ui
{
    class DialogHirfExtrapolation;
};
QT_END_NAMESPACE

namespace pst
{
    class DataChosenListDialog;
    class DialogHirfExtrapolation : public IdaDialogFrame
    {
        Q_OBJECT

    public:
        DialogHirfExtrapolation(QWidget* parent = nullptr);
        ~DialogHirfExtrapolation();
        void setCurveNameList(const QList<QString>& curveNameList);
        void setInit(QStringList& params);
        void setExtrapolationCoefficientList(const QList<QString>& extrapolationCoefficientList);

    public slots:
        void on_pushButton_confirm_clicked();
        void on_pushButton_cancel_clicked();
        void slot_sentChosenDataIds(const QModelIndexList& chosenID);
        /// @brief 添加电场曲线按钮点击
        void slot_selectDataButtonElectricFieldClicked();
        /// @brief 电流外推选择电流曲线
        void slot_selectDataButtonElectricCurrentClicked();
        /// @brief 选择外推系数下拉框点击
        /// @param index
        void on_comboBox_ExtrapolationCoefficient_currentIndexChanged(int index);

        /// @brief 电场外推单选按钮点击
        void slot_radioButton_ElectricFieldClicked();
        /// @brief 电流外推单选按钮点击
        void slot_radioButton_ElectricCurrentClicked();

        void on_checkBox_ElectricField_toggled(bool checked);
        void on_checkBox_ElectricCurrent_toggled(bool checked);

    private:

        QModelIndexList createSelectedIndexes(const QStringList& params);

    signals:
        bool signal_computeHIRF(const QString& graphNames, double incidentWaveFieldValue, const QString& HIRFName, const QString& typeName, bool isCheckBoxChecked);

    private:
        Ui::DialogHirfExtrapolation* ui;
        DataChosenListDialog* m_dataChosenListDialog;
        QList<QString> m_curveNameList;
        QList<int> m_selectedIndexsField;
        QList<int> m_selectedIndexsCurrent;
        QString m_ExtrapolationCoefficientText;
        QString m_curveNameText;
        bool m_isElectricFieldChecked{true};

        QStringListModel m_model;
    };
} // namespace pst

#endif
